//
//  UIView+ChangeFrame.m
//  01-UIView、UIWindow
//
//  Created by dllo on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "UIView+ChangeFrame.h"

@implementation UIView (ChangeFrame)
- (void)setZ_centerX:(CGFloat)z_centerX {
    CGPoint center = self.center;
    center.x = z_centerX;
    self.center = center;
}

- (CGFloat)z_centerX {
    return self.center.x;
}

- (void)setZ_centerY:(CGFloat)z_centerY {
    CGPoint center = self.center;
    center.y = z_centerY;
    self.center = center;
}

- (CGFloat)z_centerY {
    return self.center.y;
}

- (void)setZ_x:(CGFloat)z_x
{
    CGRect rect = self.frame;
    rect.origin.x = z_x;
    self.frame = rect;
}
- (CGFloat)z_x
{
    return self.frame.origin.x;
}

- (void)setZ_y:(CGFloat)z_y
{
    CGRect rect = self.frame;
    rect.origin.y = z_y;
    self.frame = rect;
}
- (CGFloat)z_y
{
    return self.frame.origin.y;
}

- (void)setZ_width:(CGFloat)z_width
{
    CGRect rect = self.frame;
    rect.size.width = z_width;
    self.frame = rect;
}

- (CGFloat)z_width
{
    return self.frame.size.width;
}

- (void)setZ_height:(CGFloat)z_height
{
    CGRect rect = self.frame;
    rect.size.height = z_height;
    self.frame = rect;
}
- (CGFloat)z_height
{
    return self.frame.size.height;
}

@end
